home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.3 / CrtTrace.3 < prev    next >
Encoding:
Text File  |  1995-07-26  |  10.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee((((3333))))           TTTTccccllll (((( ))))           TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee((((3333))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           Tcl_CreateTrace,  Tcl_DeleteTrace  -  arrange  for   command
  12.           execution to be traced
  13.  
  14.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.           ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  16.  
  17.           Tcl_Trace
  18.           TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee(_i_n_t_e_r_p, _l_e_v_e_l, _p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  19.  
  20.           TTTTccccllll____DDDDeeeelllleeeetttteeeeTTTTrrrraaaacccceeee(_i_n_t_e_r_p, _t_r_a_c_e)
  21.  
  22.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  23.           Tcl_Interp         *_i_n_t_e_r_p          (in)      Interpreter
  24.                                                         containing
  25.                                                         command to  be
  26.                                                         traced      or
  27.                                                         untraced.
  28.  
  29.           int                _l_e_v_e_l            (in)      Only  commands
  30.                                                         at   or  below
  31.                                                         this   nesting
  32.                                                         level  will be
  33.                                                         traced.      1
  34.                                                         means     top-
  35.                                                         level commands
  36.                                                         only,  2 means
  37.                                                         top-level
  38.                                                         commands    or
  39.                                                         those that are
  40.                                                         invoked     as
  41.                                                         immediate
  42.                                                         consequences
  43.                                                         of   executing
  44.                                                         top-level
  45.                                                         commands
  46.                                                         (procedure
  47.                                                         bodies,
  48.                                                         bracketed
  49.                                                         commands,
  50.                                                         etc.)  and  so
  51.                                                         on.
  52.  
  53.           Tcl_CmdTraceProc   *_p_r_o_c            (in)      Procedure   to
  54.                                                         call  for each
  55.                                                         command that's
  56.                                                         executed.  See
  57.                                                         below      for
  58.                                                         details on the
  59.                                                         calling
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/10/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee((((3333))))           TTTTccccllll (((( ))))           TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee((((3333))))
  71.  
  72.  
  73.  
  74.                                                         sequence.
  75.  
  76.           ClientData         _c_l_i_e_n_t_D_a_t_a       (in)      Arbitrary
  77.                                                         one-word value
  78.                                                         to   pass   to
  79.                                                         _p_r_o_c.
  80.  
  81.           Tcl_Trace          _t_r_a_c_e            (in)      Token      for
  82.                                                         trace   to  be
  83.                                                         removed
  84.                                                         (return  value
  85.                                                         from  previous
  86.                                                         call        to
  87.                                                         TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee).
  88.      _________________________________________________________________
  89.  
  90.  
  91.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  92.           TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee arranges for command tracing.  From now  on,
  93.           _p_r_o_c  will be invoked before Tcl calls command procedures to
  94.           process  commands  in  _i_n_t_e_r_p.   The   return   value   from
  95.           TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee  is  a  token  for  the  trace, which may be
  96.           passed to TTTTccccllll____DDDDeeeelllleeeetttteeeeTTTTrrrraaaacccceeee to remove the trace.  There may be
  97.           many  traces  in  effect simultaneously for the same command
  98.           interpreter.
  99.  
  100.           _P_r_o_c should have arguments and result that  match  the  type
  101.           TTTTccccllll____CCCCmmmmddddTTTTrrrraaaacccceeeePPPPrrrroooocccc:
  102.  
  103.                typedef void Tcl_CmdTraceProc(
  104.                     ClientData _c_l_i_e_n_t_D_a_t_a,
  105.                     Tcl_Interp *_i_n_t_e_r_p,
  106.                     int _l_e_v_e_l,
  107.                     char *_c_o_m_m_a_n_d,
  108.                     Tcl_CmdProc *_c_m_d_P_r_o_c,
  109.                     ClientData _c_m_d_C_l_i_e_n_t_D_a_t_a,
  110.                     int _a_r_g_c,
  111.                     char *_a_r_g_v[]));
  112.  
  113.           The _c_l_i_e_n_t_D_a_t_a and  _i_n_t_e_r_p  parameters  are  copies  of  the
  114.           corresponding    arguments    given    to   TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee.
  115.           _C_l_i_e_n_t_D_a_t_a typically points to an application-specific  data
  116.           structure  that  describes  what to do when _p_r_o_c is invoked.
  117.           _L_e_v_e_l gives the nesting level of the  command  (1  for  top-
  118.           level  commands passed to TTTTccccllll____EEEEvvvvaaaallll by the application, 2 for
  119.           the next-level  commands  passed  to  TTTTccccllll____EEEEvvvvaaaallll  as  part  of
  120.           parsing  or  interpreting  level-1  commands,  and  so  on).
  121.           _C_o_m_m_a_n_d points to  a  string  containing  the  text  of  the
  122.           command, before any argument substitution.  _C_m_d_P_r_o_c contains
  123.           the address of the command procedure that will be called  to
  124.           process the command (i.e. the _p_r_o_c argument of some previous
  125.           call to TTTTccccllll____CCCCrrrreeeeaaaatttteeeeCCCCoooommmmmmmmaaaannnndddd) and  _c_m_d_C_l_i_e_n_t_D_a_t_a  contains  the
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/10/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee((((3333))))           TTTTccccllll (((( ))))           TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee((((3333))))
  137.  
  138.  
  139.  
  140.           associated  client  data  for  _c_m_d_P_r_o_c (the _c_l_i_e_n_t_D_a_t_a value
  141.           passed to TTTTccccllll____CCCCrrrreeeeaaaatttteeeeCCCCoooommmmmmmmaaaannnndddd).  _A_r_g_c and _a_r_g_v give the  final
  142.           argument  information  that will be passed to _c_m_d_P_r_o_c, after
  143.           command, variable, and backslash  substitution.   _P_r_o_c  must
  144.           not modify the _c_o_m_m_a_n_d or _a_r_g_v strings.
  145.  
  146.           Tracing will only occur for commands at nesting  level  less
  147.           than  or  equal  to  the  _l_e_v_e_l  parameter  (i.e.  the _l_e_v_e_l
  148.           parameter to _p_r_o_c will always be less than or equal  to  the
  149.           _l_e_v_e_l parameter to TTTTccccllll____CCCCrrrreeeeaaaatttteeeeTTTTrrrraaaacccceeee).
  150.  
  151.           Calls to _p_r_o_c will be made by  the  Tcl  parser  immediately
  152.           before  it  calls  the  command  procedure  for  the command
  153.           (_c_m_d_P_r_o_c).   This  occurs   after   argument   parsing   and
  154.           substitution,  so  tracing  for  substituted commands occurs
  155.           before tracing of the commands containing the substitutions.
  156.           If  there  is a syntax error in a command, or if there is no
  157.           command procedure associated with a command  name,  then  no
  158.           tracing  will occur for that command.  If a string passed to
  159.           Tcl_Eval  contains  multiple  commands  (bracketed,  or   on
  160.           different lines) then multiple calls to _p_r_o_c will occur, one
  161.           for each command.  The _c_o_m_m_a_n_d  string  for  each  of  these
  162.           trace  calls  will  reflect  only  a single command, not the
  163.           entire string passed to Tcl_Eval.
  164.  
  165.           TTTTccccllll____DDDDeeeelllleeeetttteeeeTTTTrrrraaaacccceeee removes a trace, so  that  no  future  calls
  166.           will  be  made  to  the procedure associated with the trace.
  167.           After TTTTccccllll____DDDDeeeelllleeeetttteeeeTTTTrrrraaaacccceeee returns, the caller should never again
  168.           use the _t_r_a_c_e token.
  169.  
  170.  
  171.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  172.           command, create, delete, interpreter, trace
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/10/95)
  196.  
  197.  
  198.  
  199.